/**
 * @program: FindFileDemo
 * @author: Ding Houwen
 * @create: 2019-08-01 13:19
 **/

package com.example.findfiledemo.mapper;

import com.example.findfiledemo.entiy.FileEntiy;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FileMapper {

    //根据关键字查找标题
    @Select("SELECT * FROM fileindex WHERE filename like CONCAT('%',#{name},'%')")
    List<FileEntiy> FindFileByName(@Param("name") String name);
    //根据关键字查找正文
    @Select("SELECT * FROM fileindex WHERE filedetails like CONCAT('%',#{name},'%')")
    List<FileEntiy> FindFileByDetails(@Param("name") String name);
    //根据fileID查找正文
    @Select("SELECT filedetails FROM fileindex WHERE fileid like CONCAT('%',#{id},'%')")
    String FindDetailsById(int id);

}


